package com.ruoyi.labdata.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.labdata.domain.LabInstrumentScrap;
import com.ruoyi.labdata.service.ILabInstrumentScrapService;

/**
 * 仪器报废Controller
 * 
 * @author winner pan
 * @date 2022-03-02
 */
@RestController
@RequestMapping("/labdata/scrap")
public class LabInstrumentScrapController extends BaseController {
	@Autowired
	private ILabInstrumentScrapService labInstrumentScrapService;

	/**
	 * 查询仪器报废列表
	 */
	// @PreAuthorize("@ss.hasPermi('labdata:scrap:list')")
	/*@GetMapping("/list")
	public TableDataInfo list(LabInstrumentScrap labInstrumentScrap) {
		startPage();
		List<LabInstrumentScrap> list = labInstrumentScrapService.selectLabInstrumentScrapList(labInstrumentScrap);
		return getDataTable(list);
	}*/

	/**
	 * 导出仪器报废列表
	 */
	// @PreAuthorize("@ss.hasPermi('labdata:scrap:export')")
	/*@Log(title = "仪器报废", businessType = BusinessType.EXPORT)
	@GetMapping("/export")
	public AjaxResult export(LabInstrumentScrap labInstrumentScrap) {
		List<LabInstrumentScrap> list = labInstrumentScrapService.selectLabInstrumentScrapList(labInstrumentScrap);
		ExcelUtil<LabInstrumentScrap> util = new ExcelUtil<LabInstrumentScrap>(LabInstrumentScrap.class);
		return util.exportExcel(list, "scrap");
	}*/

	/**
	 * 获取仪器报废详细信息
	 */
	// @PreAuthorize("@ss.hasPermi('labdata:scrap:query')")
	/*@GetMapping(value = "/{scrapId}")
	public AjaxResult getInfo(@PathVariable("scrapId") Long scrapId) {
		return AjaxResult.success(labInstrumentScrapService.selectLabInstrumentScrapById(scrapId));
	}*/

	/**
	 * 新增仪器报废
	 */
	@PreAuthorize("@ss.hasPermi('labdata:scrap:edit')")
	@Log(title = "仪器报废", businessType = BusinessType.INSERT)
	@PostMapping
	public AjaxResult add(@RequestBody LabInstrumentScrap labInstrumentScrap) {
		return toAjax(labInstrumentScrapService.insertLabInstrumentScrap(labInstrumentScrap));
	}

	/**
	 * 修改仪器报废
	 */
	//@PreAuthorize("@ss.hasPermi('labdata:scrap:edit')")
	/*@Log(title = "仪器报废", businessType = BusinessType.UPDATE)
	@PutMapping
	public AjaxResult edit(@RequestBody LabInstrumentScrap labInstrumentScrap) {
		return toAjax(labInstrumentScrapService.updateLabInstrumentScrap(labInstrumentScrap));
	}*/

	/**
	 * 删除仪器报废
	 */
	// @PreAuthorize("@ss.hasPermi('labdata:scrap:remove')")
	/*@Log(title = "仪器报废", businessType = BusinessType.DELETE)
	@DeleteMapping("/{scrapIds}")
	public AjaxResult remove(@PathVariable Long[] scrapIds) {
		return toAjax(labInstrumentScrapService.deleteLabInstrumentScrapByIds(scrapIds));
	}*/
}
